import 'package:share_fit/app/controllers/base/base_controller.dart';
import 'package:share_fit/app/controllers/space/service/health_state.dart';
import 'package:share_fit/app/helper/ext/tr_ext.dart';
import 'package:share_fit/app/helper/health_helper.dart';
import 'package:share_fit/generated/locales.g.dart';

class HealthLogic extends BaseController {

  final state = HealthState();

  updateAuth(bool value) {

  }

  Future authorize() async {
    if (state.isHealthAuthed) {
      showTips(LocaleKeys.info.ts, LocaleKeys.app_health_is_authed.ts);
    }
    await HealthHelper.instance.authorize();
  }

  @override
  String getRemotePath() {
    return "";
  }

  @override
  void initState() {
    state.isHealthAuthed = read(HealthHelper.healthAuthed, defaultValue: false, global: true);
  }

  @override
  void onRemoteEvent(event, method) {
    // TODO: implement onRemoteEvent
  }

}